// 引入react
import * as React from 'react';
import {StyleSheet,View,Text,ScrollView} from 'react-native';
import AllStyle from '../../../style';
import {HeaderTitle} from '../../../componet/settingComponent/HeaderTitle';
import {SafeAreaView} from 'react-native-safe-area-context';
import {MyStatistics} from './MyStatistics';

/**
 * @Description:
 * @author TangYong
 * @date 2023/2/11
 */
export class AllUserStatistics extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
        };
    }
    //生命周期：组件挂载后
    componentDidMount() {
      //alert(this.props.route.params.userId)
    }

    //方法
    back = () => {
        this.props.navigation.goBack();
    };
    goto = (name, params) => {
        //console.log(name);

        const route = {
            name: name,
            params: {
                //routePathName: this.props.route.name,
                ...params,
            },

        };
        this.props.navigation.navigate(route);
    };
    //DOM
    render() {
        return (
            <SafeAreaView edges={['top', 'left', 'right']} style={{flex: 1, backgroundColor: '#FFF'}}>
                <View style={AllStyle.container}>
                    <HeaderTitle goBack={() => {
                        this.back();
                    }} headtitle={'统计'}
                    />
                    <ScrollView style={[AllStyle.padding15]}>
                    <MyStatistics userId={this.props.route.params.userId} date={this.props.route.params.date}  navigation={this.props.navigation}></MyStatistics>
                    </ScrollView>
                </View>
            </SafeAreaView>
        )
    }

}

const style = StyleSheet.create({
    //样式
})

